Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codebuild: Fix service_role Required #4826

Merged
merged 1 commit into from
Jul 9, 2018
Merged

codebuild: Fix service_role Required #4826

merged 1 commit into from
Jul 9, 2018

Conversation

koooge
Copy link
Contributor

@koooge koooge commented Jun 13, 2018

Changes proposed in this pull request:

  • Change 1
    codebuild) service_role seems to be required.
$ terraform apply -auto-approve
aws_codebuild_project.test: Creating...
  artifacts.#:                                   "" => "1"
  artifacts.1178773975.location:                 "" => ""
  artifacts.1178773975.name:                     "" => ""
  artifacts.1178773975.namespace_type:           "" => ""
  artifacts.1178773975.packaging:                "" => ""
  artifacts.1178773975.path:                     "" => ""
  artifacts.1178773975.type:                     "" => "NO_ARTIFACTS"
  badge_enabled:                                 "" => "false"
  badge_url:                                     "" => "<computed>"
  build_timeout:                                 "" => "60"
  description:                                   "" => "<computed>"
  encryption_key:                                "" => "<computed>"
  environment.#:                                 "" => "1"
  environment.4086057901.compute_type:           "" => "BUILD_GENERAL1_SMALL"
  environment.4086057901.environment_variable.#: "" => "<computed>"
  environment.4086057901.image:                  "" => "aws/codebuild/ubuntu-base:14.04"
  environment.4086057901.privileged_mode:        "" => "false"
  environment.4086057901.type:                   "" => "LINUX_CONTAINER"
  name:                                          "" => "test"
  service_role:                                  "" => "<computed>"
  source.#:                                      "" => "1"
  source.1008781261.auth.#:                      "" => "0"
  source.1008781261.buildspec:                   "" => ""
  source.1008781261.git_clone_depth:             "" => "1"
  source.1008781261.insecure_ssl:                "" => ""
  source.1008781261.location:                    "" => "https://github.com/koooge/test.git"
  source.1008781261.type:                        "" => "GITHUB"

Error: Error applying plan:

1 error(s) occurred:

* aws_codebuild_project.test: 1 error(s) occurred:

* aws_codebuild_project.test: [ERROR] Error creating CodeBuild project: InvalidInputException: Service role is required
	status code: 400, request id: b26386fd-6ef5-11e8-a338-a9dceb58bb87

Output from acceptance testing:
sorry I did not run test. 🙇

@ghost ghost added the size/XS Managed by automation to categorize the size of a PR. label Jun 13, 2018
@bflad bflad added bug Addresses a defect in current functionality. service/codebuild Issues and PRs that pertain to the codebuild service. labels Jun 13, 2018
@bflad
Copy link
Contributor

bflad commented Jun 13, 2018

@koooge thanks for submitting this! Admittedly, I ran into this behavior as well when re-vamping the acceptance testing for the resource recently and was confused why it was not listed as required in the CodeBuild API CreateProjectInput. I'm wondering if there is currently a valid situation when the IAM role would not be required or that maybe in the future they plan on supporting an IAM service-linked role -- let me open an AWS Support case to find out some more information.

@bflad bflad added the upstream Addresses functionality related to the cloud provider. label Jun 19, 2018
@bflad
Copy link
Contributor

bflad commented Jun 19, 2018

I'm still waiting for an AWS Support response about this.

@bflad
Copy link
Contributor

bflad commented Jun 20, 2018

This change is looking promising, but let's wait for the service team to respond:

Thank you for having brought this discrepancy to our notice. I could observe that this property has been marked as required in the Cloudformation documentation, but is not required as per most of the other API docs. I have raised an ticket to the internal team to better understand the nature of this property as well as to ensure that the documentation is made consistent.

I shall get back to you soon as I have a response from the service team.

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We finally received the following AWS Support response:

"Service Role is required when creating a CodeBuild Project. If you create through the console, the console may automatically create one Service Role for you just to enhance customer experience. This seems to be a documentation issue, because looking at the service role play in CodeBuild, it's required for at least sending the logs to CloudWatch Logs. The docs team has been notified of the change. In the future, the customer can always give feedback to the docs team (through the Give Feedback link). This would be helpful in getting a faster response.

Thanks for pointing out the discrepancy and for reaching out."

Thus, to reiterate, the Service Role seems to be a required property as you rightly pointed out. The documentation will also be reflected to point to the same.

Given that, let's get this merged. Thanks @koooge! 🚀

@bflad bflad added this to the v1.27.0 milestone Jul 9, 2018
@bflad bflad merged commit f2b2e6f into hashicorp:master Jul 9, 2018
bflad added a commit that referenced this pull request Jul 9, 2018
@bflad
Copy link
Contributor

bflad commented Jul 11, 2018

This has been released in version 1.27.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 4, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/codebuild Issues and PRs that pertain to the codebuild service. size/XS Managed by automation to categorize the size of a PR. upstream Addresses functionality related to the cloud provider.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants